home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_Functions_VBScript.asp < prev    next >
Encoding:
Text File  |  1998-05-29  |  1.3 KB  |  55 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3.  
  4. <!*************************
  5. This sample is provided for educational purposes only. It is not intended to be 
  6. used in a production environment, has not been tested in a production environment, 
  7. and Microsoft will not provide technical support for it. 
  8. *************************>
  9.  
  10. <SCRIPT LANGUAGE=VBScript RUNAT=Server>
  11.  
  12.     'Define Server Side Script Function.
  13.     Function PrintOutMsg(strMsg, intCount)
  14.         Dim i
  15.  
  16.         'Output Message count times.
  17.         For i = 1 to intCount
  18.             Response.Write(strMsg & "<BR>")    
  19.         Next
  20.  
  21.         'Return number of iterations.
  22.         PrintOutMsg = intCount    
  23.     End Function
  24.     
  25. </SCRIPT>
  26.  
  27.  
  28. <HTML>
  29.     <HEAD>
  30.         <TITLE>Functions</TITLE>
  31.     </HEAD>
  32.  
  33.     <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
  34.         
  35.         <!-- Display header. -->
  36.         <FONT SIZE="4" FACE="ARIAL, HELVETICA">
  37.         <B>Server Side Functions</B></FONT><BR>   
  38.  
  39.         <P>
  40.         The function "PrintOutMsg" prints out a specific message a set number of times.<P>
  41.         
  42.  
  43.         <%
  44.             'Store number of times function printed message.
  45.             Dim intTimes
  46.         
  47.             'Call function.            
  48.             intTimes = PrintOutMsg("This is a function test!", 4)
  49.  
  50.             'Output the function return value.
  51.             Response.Write("<p>The function printed out the message " & intTimes & " times.")
  52.         %>
  53.     </BODY>
  54. </HTML>
  55.